package com.ruoyi.message.service.impl;

import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.message.mapper.MessageMapper;
import com.ruoyi.message.model.MsgCirculation;
import com.ruoyi.message.service.MessageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class MessageServiceImpl implements MessageService {

    @Autowired
    MessageMapper mapper;

    @Override
    public List<MsgCirculation> selectByUserId(MsgCirculation msg) {
        return mapper.selectByUserId(msg);
    }

    @Override
    public int confirm(Long id) {
        return mapper.confirm(id);
    }

    @Override
    public Integer selectSum() {
        Integer i = mapper.selectSum1(SecurityUtils.getUserId());
        Integer j = mapper.selectSum2(SecurityUtils.getUserId());
        return i+j;
    }
}
